import request from '@/utils/request';
import { stringify } from 'qs';
import { toFormData } from '@/utils/utils.jsx';

//分页提醒列表
export async function getTableDataOp(params) {
  return request(`/blade-user/notice/pageNotices`, {
    method: 'post',
    data: params,
  });
}

//列举提醒类型
export async function listNoticeTypes(params) {
  return request(`/blade-user/notice/listNoticeTypes?${stringify(params)}`);
}

//保存提醒
export async function saveOrUpdate(params) {
  return request(`/blade-user/notice/saveOrUpdate`, {
    method: 'post',
    data: params,
  });
}

//删除提醒
export async function deleteNotice(params) {
  return request(`/blade-user/notice/delete`, {
    method: 'post',
    body: toFormData(params),
  });
}

//提醒联系人列表
export async function queryPersonList(params) {
  return request(`/blade-user/notice/person/list?${stringify(params)}`);
}

//查询可能得提醒联系人列表
export async function queryNoticeList(params) {
  return request(`/blade-user/user/notice/list?${stringify(params)}`);
}

//保存提醒联系人
export async function savePersonUpdate(params) {
  return request(`/blade-user/notice/person/save`, {
    method: 'post',
    data: params,
  });
}

//删除提醒
export async function deletePerson(params) {
  return request(`/blade-user/notice/person/delete?${stringify(params)}`);
}
